package basic_practice_1024;

import java.util.Scanner;
/**
 * @author MemoryC
 * */

public class Main {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		
		while(scanner.hasNext()) {
			int n=scanner.nextInt();
			if(n==0) {
				break;
			}
			System.out.println((int)Math.pow(2, n-1)*3-2);
		}
		scanner.close();
    }
}